import java.io.File;
import java.io.IOException;

public class Demo1 {
    public static void main(String[] args) throws IOException {
        File file=new File("C:\\Users\\戎宇1\\IdeaProjects\\java-ee\\test.txt");
       // File file=new File("./test.txt");
        System.out.println(file.getParent());
        System.out.println(file.getName());
        System.out.println(file.getPath());
        //不会写出我没写的相对路径
        System.out.println(file.getAbsolutePath());
        //全部写出来
        System.out.println(file.getCanonicalPath());

    }
}